from re import S, T
from numpy import square
from manimlib import *
#75cfb8
#bbdfc8
#f0e5d8
#ffc478
class p1(Scene):
    def construct(self):
        # self.add(NumberPlane())
        frame = self.camera.frame
        # self.play(frame.animate.set_width(16))
        side=6
        half=side/2
        a,b,c,d=[-half,half,0],[half,half,0],[half,-half,0],[-half,-half,0]
        s=Square(side)
        e,f=[-0.2,-half,0],[half,0.82,0]
        ae,af,ef=Line(a,e),Line(a,f),Line(e,f)
        self.add(ae,af,ef,s)
        # angle
        eaf,afb,aef=Arc(-65*DEGREES,45*DEGREES,arc_center=a),Arc(PI/2,70*DEGREES,arc_center=f),Arc(50*DEGREES,65*DEGREES,arc_center=e)
        # tex
        self.add(Tex('A').next_to(a,UL),Tex('B').next_to(b,UR),Tex('C').next_to(c,DR),Tex('D').next_to(d,DL),Tex('E').next_to(e,DOWN),Tex('F').next_to(f,RIGHT))
        t45,t70,tt=Tex('45^\circ').next_to(a,DR),Tex('70^\circ').next_to(f,UL).shift(UR*0.1),Tex('?').next_to(e,UP,buff=0.5)
        self.add(eaf,afb,aef,t45,t70,tt)
        self.wait()
class p2(Scene):
    def construct(self):
        # self.add(NumberPlane())
        frame = self.camera.frame
        # self.play(frame.animate.set_width(16))
        side=6
        half=side/2
        a,b,c,d=[-half,half,0],[half,half,0],[half,-half,0],[-half,-half,0]
        s=Square(side)
        e,f=[-0.2,-half,0],[half,0.82,0]
        ae,af,ef=Line(a,e),Line(a,f),Line(e,f)
        f_=[-5.18,-3,0]
        self.add(Polygon(a,b,f).set_fill('#75cfb8',1),Polygon(a,d,f_).set_fill('#75cfb8',1))
        af_,df_=Line(a,f_),Line(d,f_)
        self.add(ae,af,ef,s)
        # angle
        eaf,afb,aef=Arc(-65*DEGREES,45*DEGREES,arc_center=a),Arc(PI/2,70*DEGREES,arc_center=f),Arc(50*DEGREES,65*DEGREES,arc_center=e)
        # tex
        self.add(Tex('A').next_to(a,UL),Tex('B').next_to(b,UR),Tex('C').next_to(c,DR),Tex('D').next_to(d,DL),Tex('E').next_to(e,DOWN),Tex('F').next_to(f,RIGHT),Tex('F^\prime').next_to(f_,DL))
        t45,t70,tt=Tex('45^\circ').next_to(a,DR),Tex('70^\circ').next_to(f,UL).shift(UR*0.1),Tex('?').next_to(e,UP,buff=0.5)
        self.add(eaf,afb,aef,t45,t70,tt)
        ###
        self.add(af_,df_)
        self.wait()